import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
export interface UploadRoleResult {
  errors: string[];
  lineNum: string;
}

export type UserParams = BasicPageParams & {
  account?: string;
  nickname?: string;
  roleId?: string[];
};

export type RoleParams = {
  roleName?: string;
  roleId?: string;
};

export type RolePageParams = BasicPageParams & RoleParams;

export type PostParams = {
  postName?: string;
  postId?: string;
};

export type TenantParams = {
  name: string;
  code: string;
  statTime: string;
  endTime: string;
  tenantDomain?: string;
  status: string | number;
};
export type PostPageParams = BasicPageParams & PostParams;
export type TenantPageParams = BasicPageParams & TenantParams;

export type ParamParams = {
  publicName: string;
  publicKey: string;
  publicType: string;
  publicValue: string;
  systemFlag: string;
  status: string | number;
  validateCode: string;
};
export type ParamPageParams = BasicPageParams & ParamParams;

export type UserDeptPostPageParams = BasicPageParams & {
  deptName: string;
  postName: string;
};

interface SaveUserDeptPostParamsPostUsers {
  postId: string | number;
  userIds: string | number[];
}
export type SaveUserDeptPostParams = {
  deptId: string | number;
  postUsers: Array<SaveUserDeptPostParamsPostUsers>;
};

export type AddressListParams = {
  name?: string;
  addressType?: number;
};

export type AddressUserListParams = {
  name?: string;
  deptId?: number | string;
  addressType?: number;
  nameSort?: number;
};

export type DeptParams = {
  deptName?: string;
  status?: string;
  deptId?: string;
};

export type MenuParams = {
  menuName?: string;
  status?: string;
  client?: number;
};

export interface UserListItem {
  id: string;
  account: string;
  email: string;
  nickname: string;
  role: number;
  createTime: string;
  remark: string;
  status: number;
}

export interface DeptListItem {
  deptId: string;
  parentId: string;
  tenantId: string;
  remark: string;
  sortOrder: number;
  deptLevel: number | string;
  deptType: number | string;
  deptPrin: number | string;
  enable: number | string;
}

export interface MenuListItem {
  id: string;
  orderNo: string;
  createTime: string;
  status: number;
  icon: string;
  component: string;
  permission: string;
}
export type OptionsItem = {
  label: string;
  value: string;
  disabled?: boolean;
  roleId: string;
  roleName: string;
  roleCode: string;
  orderNo: string;
  createTime: string;
};
export interface RoleListItem {
  roleId: string;
  roleName: string;
  roleCode: string;
  orderNo: string;
  createTime: string;
  label?: string;
  value?: string;
  disabled?: boolean;
}
export interface PostListItem {
  postId: string;
  postName: string;
  postCode: string;
  orderNo: string;
  createTime: string;
}
export interface DictListItem {
  dictType: string;
  description: string;
  delFlag: string;
  systemFlag: string;
  remarks: string;
  label?: string;
  value?: string;
  sortOrder?: number;
  createTime: string;
}
export interface UserDeptPostPageItem {
  deptId: number;
  postId: number;
  deptName: string;
  postName: string;
  userNames: string;
  names: string;
}

export type AppMenuParam = {
  client: number;
  menuType: number;
};

export type Key = string | number;

type ApplyTaskItem = {
  applyId: string;
};

export interface ApplyTask {
  taskType: string;
  checkType: string;
  startTime: string;
  endTime: string;
  caliberId: string;
  operateId: string;
  userId: string;
  apples: ApplyTaskItem[];
}

/**
 * @description: Request list return value
 */
export type UserListGetResultModel = BasicFetchResult<UserListItem>;

export type DeptListGetResultModel = BasicFetchResult<DeptListItem>;

export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;

export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;

export type PostPageListGetResultModel = BasicFetchResult<PostListItem>;

export type TenantPageListGetResultModel = BasicFetchResult<TenantParams>;

export type ParamPageListGetResultModel = BasicFetchResult<ParamParams>;

export type DictPageListGetResultModel = BasicFetchResult<DictListItem>;

export type UserDeptPostPageResultModel = BasicFetchResult<UserDeptPostPageItem>;

export type RoleListGetResultModel = OptionsItem[];
